interface CalculateOrderPriceAPIResData {
  code: number
  msg: string
  time: string
  data: {
    total_price: number
    start_kilomite: string
    start_price: string
    start_timeout_price: string
    distance: number
    real_price: number
  }
}

export interface CalculateOrderPriceAPIParams {
  start_latitude: string
  start_longitude: string
  end_latitude: string
  end_longitude: string
  coupon_id?: string
}

export function calculateOrderPriceAPI(params: CalculateOrderPriceAPIParams, token: string) {
  return httpInstance.get<CalculateOrderPriceAPIResData, CalculateOrderPriceAPIParams>(
    '/api/order/orderprice',
    { params, headers: { token } },
  )
}
